import { useRef } from 'react'

/**
 * @description - 是否已经初始化
 * @params {boolean} check
 * @returns {boolean}
 */
export const useInitialized = (check?: boolean): boolean => {
  const initializedRef = useRef(check)
  if (check) {
    initializedRef.current = true
  }
  return !!initializedRef.current
}
